package cn.cfoodc.sharding.service.impl;

import cn.cfoodc.sharding.domain.TOrderItem;
import cn.cfoodc.sharding.mapper.TOrderItemMapper;
import cn.cfoodc.sharding.service.TOrderItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TOrderItemServiceImpl implements TOrderItemService{

    @Autowired
    private TOrderItemMapper tOrderItemMapper;


    @Override
    public int deleteByPrimaryKey(Long orderItemId) {
        return tOrderItemMapper.deleteByPrimaryKey(orderItemId);
    }

    @Override
    public int insert(TOrderItem record) {
        return tOrderItemMapper.insert(record);
    }

    @Override
    public TOrderItem selectByPrimaryKey(Long orderItemId,Long userId) {
        return tOrderItemMapper.selectByPrimaryKey(orderItemId,userId);
    }


    @Override
    public int updateByPrimaryKey(TOrderItem record) {
        return tOrderItemMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<TOrderItem> selectPage(Long userId, Long orderId, int indexLine, int pageSize) {
        return tOrderItemMapper.selectPage(userId ,orderId,indexLine,pageSize);
    }

    @Override
    public List<TOrderItem> selectAllPage(int i, int pageSize) {
        return tOrderItemMapper.selectAllPage(i,pageSize);
    }

    @Override
    public int updateOrderItemOne(TOrderItem tOrderItem) {
        return tOrderItemMapper.updateOrderItemOne(tOrderItem);
    }


}
